# Contributor: Grigory Kirillov <txgk@bk.ru>
# Maintainer: Celeste <cielesti@protonmail.com>
maintainer="Celeste <cielesti@protonmail.com>"
pkgname=eclib
pkgver=20240408
pkgrel=1
pkgdesc="Tools for creating the elliptic curve databases"
url="https://github.com/JohnCremona/eclib"
# armhf, armv7, x86: blocked by pari
# s390x: blocked by flint
arch="all !armhf !armv7 !s390x !x86"
license="GPL-2.0-or-later"
makedepends="boost-dev flint-dev libntl-dev pari-dev"
subpackages="$pkgname-static $pkgname-dev $pkgname-libs $pkgname-doc"
source="https://github.com/JohnCremona/eclib/releases/download/v$pkgver/eclib-$pkgver.tar.bz2"

build() {
	CXXFLAGS="$CXXFLAGS -O2 -flto=auto" \
	./configure \
		--target=$CTARGET \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--localstatedir=/var \
		--with-boost=yes \
		--enable-mpfp
	make
}

check() {
	make check
}

package() {
	make DESTDIR="$pkgdir" install
}

sha512sums="
d93c724fa5816ce45a661d50000309e148fdbd0e287fbdbbf30bd6b3c6a7225846d90f11bc4d86c4b96111cbe8429b174e7d81ea0be1eef1a8acaa43287c09cf  eclib-20240408.tar.bz2
"
